
*** This dofile uses an extract of the Chinese Child Twins Survey 2002
* For details of this supplementary dataset, please refer to Rosenzweig & Zhang (2009) RES paper

use ../raw/CCTS2002/child2002, clear

** Table A9

	* variables to sum
local family " ageP1 ageP2 eduyP1 eduyP2 famIncome "

local fexp "cigaretteP1 alcoholP1 clothP1 "
local mexp "cosmeticP2 clothP2 "

local fwork "lfpP1 daysWorkLMP1 privateBusinessP1 out30P1 "
local mwork "lfpP2 daysWorkLMP2 privateBusinessP2 out30P2 "

gl SUMFAMILY = "`family' `fexp' `mexp' `fwork' `mwork' "

	* display format
format $SUMFAMILY %9.2f

gl SUMFAMILY_fmt ""
foreach var in $SUMFAMILY {
	gl SUMFAMILY_fmt = "$SUMFAMILY_fmt" + "`var'(fmt(2)) "
}

display "$SUMFAMILY_fmt"

	* summary
est clear
estpost tabstat $SUMFAMILY ///
, s(mean sd n) by(twin) nototal
esttab using ../output/TableA9_tabSumCCTS.csv, ///
cells("$SUMFAMILY_fmt")  noobs nonote nomtitle nonumber replace


** Table A10

* expenditures
local expP1 "lncigaretteP1 lnalcoholP1 lnclothP1  "
local expP2 "lncosmeticP2 lnclothP2  "

local dep = " `expP1' `expP2' " 
local ctrl =  " ageP1 agesqP1 ageP2 agesqP2 eduyP1 eduyP2  "
local outvars = " twin "

est clear

foreach v of varlist `dep' {
display "Dependent Variable: `v' "
display "Sample `i'"
eststo: reg `v' twin age2birthP2 `ctrl', cluster(hhcode)
}

esttab using ../output/TableA10_PanelA.csv, /// 
keep(`outvars' ) ///
order(`outvars' ) ///
b(3) se(3) star(* .10 ** .05 *** .01) r2(2) nogaps constant label n replace

* parental labor supply
local workP1 "lfpP1 lndaysWorkLMP1 privateBusinessP1 out30P1 "
local workP2 "lfpP2 lndaysWorkLMP2 privateBusinessP2 out30P2 "

local dep = "`workP1' `workP2'  "  
local ctrl =  " ageP1 agesqP1 ageP2 agesqP2 eduyP1 eduyP2  "
local outvars = " twin "

est clear

foreach v of varlist `dep' {
display "Dependent Variable: `v' "
display "Sample `i'"
eststo: reg `v' twin age2birthP2 `ctrl', cluster(hhcode)
}

esttab using ../output/TableA10_PanelBC.csv.csv, /// 
keep(`outvars' ) ///
order(`outvars' ) ///
b(3) se(3) star(* .10 ** .05 *** .01) r2(2)  nogaps constant label n replace


